//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package nc.bs.pub.action;

import nc.bs.common.projectFAUtils;
import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.pu.m422x.IStoreReqAppApprove;
import nc.vo.pu.m422x.entity.StoreReqAppVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.pubapp.pub.power.PowerActionEnum;
import nc.vo.scmpub.res.billtype.POBillType;
import nc.vo.uap.pf.PFBusinessException;
import nccloud.vo.scmpub.utils.power.DataPermissionUtil;

public class N_422X_SAVE extends AbstractCompiler2 {
    public N_422X_SAVE() {
    }

    public String getCodeRemark() {
        return "\tObject retValue = null;\nnc.vo.pu.m422x.entity.StoreReqAppVO[] vos = (nc.vo.pu.m422x.entity.StoreReqAppVO[])getVos();\nretValue = nc.bs.framework.common.NCLocator.getInstance().lookup(nc.itf.pu.m422x.IStoreReqAppApprove.class).sendapprove(vos,this);\nreturn retValue;\n";
    }

    public Object runComClass(PfParameterVO vo) throws BusinessException {
        try {
            super.m_tmpVo = vo;
            Object retValue = null;
            StoreReqAppVO[] vos = (StoreReqAppVO[])((StoreReqAppVO[])this.getVos());
            if (vo.isCloudEntry) {
                DataPermissionUtil.checkPermission(vos, POBillType.MRBill.getCode(), PowerActionEnum.COMMIT.getActioncode(), "vbillcode");
            }

            //lhw 231124 保存前校验项目begin
			new projectFAUtils().projectDataApprove("po_storereq", vos, "commit");
			//end
            
            retValue = ((IStoreReqAppApprove)NCLocator.getInstance().lookup(IStoreReqAppApprove.class)).sendapprove(vos, this);
            return retValue;
        } catch (Exception var4) {
            if (var4 instanceof BusinessException) {
                throw (BusinessException)var4;
            } else {
                throw new PFBusinessException(var4.getMessage(), var4);
            }
        }
    }
}
